package com.greateamd.timetableasy.client.services.user;

import java.util.Date;
import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.greateamd.timetableasy.client.domain.AuthType;
import com.greateamd.timetableasy.domain.Event;
import com.greateamd.timetableasy.domain.User;
import com.greateamd.timetableasy.domain.exceptions.DBServerSideException;
import com.greateamd.timetableasy.domain.exceptions.IllegalEntityStateException;

@RemoteServiceRelativePath("user.rpc")
public interface UserService extends RemoteService {

	boolean remove(User user)throws DBServerSideException,IllegalEntityStateException;
	boolean save(User user)throws DBServerSideException,IllegalEntityStateException;
	boolean update(User user) throws DBServerSideException,IllegalEntityStateException;
	User find(String username) throws DBServerSideException,IllegalEntityStateException;
	List<User> getAll() throws DBServerSideException,IllegalEntityStateException;
	
	List<User> getAllCampusManager() throws DBServerSideException,IllegalEntityStateException;
	List<User> getAllTeachers()throws DBServerSideException,IllegalEntityStateException;
	List<User> getUserWithoutPromotion()throws DBServerSideException,IllegalEntityStateException;

	List<Event> getPlanning(User user, Date from, Date to)throws DBServerSideException,IllegalEntityStateException;
	List<Event> getTeacherPlanning(User user, Date fromDate, Date toDate);
	
	boolean removeUserAuth(User user,AuthType auth) throws DBServerSideException,IllegalEntityStateException;
	boolean addUserAuth(User user, AuthType auth) throws DBServerSideException,IllegalEntityStateException;
	boolean addEvent(Event event) throws DBServerSideException,IllegalEntityStateException;
	
	boolean getTeacherDisponibility(Integer excluseThisEventId,String teacherUsername,Date from,int duration)throws DBServerSideException,IllegalEntityStateException;
	
}
